package com.hotel.po.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hotel.po.mapper.SeasonPriceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SeasonPriceService {

    @Autowired
    private SeasonPriceMapper seasonPriceMapper;

    public PageInfo<Map<String, String>> list(Long roomId, int page, int size) {
        PageHelper.startPage(page, size);
        List<Map<String, String>> data = seasonPriceMapper.list(roomId);
        return new PageInfo<>(data);
    }

    public Long create(Map<String, Object> body) { return seasonPriceMapper.insert(body); }

    public void update(Map<String, Object> body) { seasonPriceMapper.update(body); }

    public void delete(Long id) { seasonPriceMapper.delete(id); }
}


